#pragma once

#include "DisholDevice.h"

namespace Dishol
{

class DeviceManager
{
public:
	DeviceManager();
	virtual ~DeviceManager();

	void			update();
	const Devices&	getDevices() const;

	class Listener
	{
	public:
		virtual ~Listener() {}
		virtual void onDeviceAdding( DeviceManager* /*deviceManager*/ ) {}
		virtual void onDeviceAdded( DeviceManager* /*deviceManager*/, Device* /*device*/ ) {}
		virtual void onDeviceRemoving( DeviceManager* /*deviceManager*/, Device* /*device*/ ) {}
		virtual void onDeviceRemoved( DeviceManager* /*deviceManager*/, Device* /*device*/ ) {}		// Do not use the device passed as parameter as it's been deleted
	};

	void			addListener( Listener* listener );
	bool			removeListener( Listener* listener );

private:
	class Internals;
	Internals*		mInternals;
};

}
